<f:subview id="#{widget.id}"
  rendered="#{not empty field_0}"
  xmlns:f="http://java.sun.com/jsf/core"
  xmlns:h="http://java.sun.com/jsf/html"
  xmlns:nxd="http://nuxeo.org/nxweb/document"
  xmlns:nxh="http://nuxeo.org/nxweb/html"
  xmlns:nxu="http://nuxeo.org/nxweb/util">

  <h:outputText class="boldLabel" value=" #{messages['label.summary.download.attachments']}"/>
  <div class="attachments">
    <nxu:inputList value="#{field_0}"  id="files_input" model="model">
      <div class="detailList">

        <nxh:graphicImage
           value="#{nxd:fileIconPath(field_0[model.rowIndex].file)}"
           rendered="#{! empty nxd:fileIconPath(field_0[model.rowIndex].file)}" />
        <h:outputText value="#{field_0[model.rowIndex].filename}"/>
        <h:outputText styleClass="detail"
          value=" #{nxu:printFileSize(field_0[model.rowIndex].file.length)}"/>

        <nxu:methodResult name="hasPDFCapabilities"
          value="#{conversionActions.isExportableToPDF(field_0[model.rowIndex].file)}">
          <h:panelGroup rendered="#{hasPDFCapabilities}">
            <h:commandLink action="#{conversionActions.generatePdfFile}">
              <f:param name="fileFieldFullName"
                value="#{nxd:propertyPath('files:files', model.rowIndex, 'file')}" />
              <f:param name="filename" value="#{field_0[model.rowIndex].filename}" />
              <nxh:graphicImage value="/icons/pdf.png"
                title="#{messages['label.document.generatePdf']}"
                alt="#{messages['label.document.generatePdf']}"/>
            </h:commandLink>
          </h:panelGroup>
        </nxu:methodResult>
        <nxh:outputLink
          value="#{nxd:complexFileUrl('downloadFile', field_1, 'files:files', model.rowIndex, 'file', field_0[model.rowIndex].filename)}">
          <nxh:graphicImage value="/icons/download.png"
            title="#{messages['label.document.download']}"
            alt="#{messages['label.document.download']}"/>
        </nxh:outputLink>
      </div>
    </nxu:inputList>
  </div>

</f:subview>
